package com.nuaa.ange.controller;

import com.nuaa.ange.service.*;
import com.nuaa.ange.shiro.AccountProfile;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @description
 * @author 玦离
 * @date 2023/1/1 14:43
 */

public class BaseController {

    @Autowired
    ArticleService articleService;

    @Autowired
    ArticlePicService articlePicService;

    @Autowired
    MessageService messageService;

    @Autowired
    OssService ossService;

    @Autowired
    ReplyService replyService;

    @Autowired
    ReplyPicService replyPicService;

    @Autowired
    ScanHistoryService scanHistoryService;

    @Autowired
    SchoolService schoolService;

    @Autowired
    SearchHistoryService searchHistoryService;

    @Autowired
    StarService starService;

    @Autowired
    SmsService smsService;

    @Autowired
    SysMessageService sysMessageService;

    @Autowired
    TagService tagService;

    @Autowired
    UserService userService;

    protected AccountProfile getProfile() {
       return (AccountProfile)SecurityUtils.getSubject().getPrincipal();
    }

    protected int getProfileId() {
        return getProfile().getUserId();
    }

}
